package constant;

import java.util.Arrays;

public enum DBType {

  mysql("mysql"),
  dm("dm"),
  doris("doris"),
  hive("hive");

  private final String code;

  public static DBType queryDBType(String dbType) {
    return Arrays.stream(DBType.values()).filter(db -> db.code.equalsIgnoreCase(dbType)).findFirst().orElse(null);
  }

  DBType(String code) {
    this.code = code;
  }

  public String getCode() {
    return code;
  }
}
